package main

import "fmt"

type Person struct {
	Name string
	Age  int
}

// 此处打印名字
//func (person Person) showAge() {
//	fmt.Println(person.Age)
//}

// 此处修改了Name
func (person *Person) changeName(newName string) {
	person.Name = newName
}

func main() {
	person := Person{"张三", 11}
	//person.showName()
	//fmt.Println(person.Name)

	person.changeName("李四")
	fmt.Println(person.Name)
}
